package com.cskaoyan.app.service.impl;

import com.cskaoyan.app.bean.common.CommonData;
import com.cskaoyan.app.bean.vo.RegionDataVO;
import com.cskaoyan.app.mapper.MarketRegionMapper;
import com.cskaoyan.app.service.AdminRegionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminRegionServiceImpl implements AdminRegionService {

    @Autowired
    MarketRegionMapper mapper;

    @Override
    public CommonData<RegionDataVO> listRegion() {
        List<RegionDataVO> list = mapper.queryAllRegion();
        PageHelper.startPage(1, 31);
        PageInfo<RegionDataVO> pageInfo = new PageInfo<>(list);
        return CommonData.data(pageInfo);
    }
}
